# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SourceRepo.V1.Model.PubsubConfig do
  @moduledoc """
  Configuration to publish a Cloud Pub/Sub message.

  ## Attributes

  *   `messageFormat` (*type:* `String.t`, *default:* `nil`) - The format of the Cloud Pub/Sub messages.
  *   `serviceAccountEmail` (*type:* `String.t`, *default:* `nil`) - Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
  *   `topic` (*type:* `String.t`, *default:* `nil`) - A topic of Cloud Pub/Sub. Values are of the form `projects//topics/`. The project needs to be the same project as this config is in.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :messageFormat => String.t() | nil,
          :serviceAccountEmail => String.t() | nil,
          :topic => String.t() | nil
        }

  field(:messageFormat)
  field(:serviceAccountEmail)
  field(:topic)
end

defimpl Poison.Decoder, for: GoogleApi.SourceRepo.V1.Model.PubsubConfig do
  def decode(value, options) do
    GoogleApi.SourceRepo.V1.Model.PubsubConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.SourceRepo.V1.Model.PubsubConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
